package com.jse.util.collection.set;

import org.junit.Test;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * @author : zenghua
 * @version : v0.1 HashSetTest.java
 * @since : 2017/6/3 10:08
 */
public class HashSetTest {
    /**
     * 3990,4132,4184,2722,4185,4186,4187,4194,4224
     *
     * 参考资料：
     * Java遍历HashSet为什么输出是有序的？https://www.zhihu.com/question/28414001
     */
    @Test
    public void testHashSet() {
        Set<Integer> set = new HashSet<Integer>();
        Collections.addAll(set, 3990,4132,4184,2722,4185,4186,4187,4194,4224);

        for (Integer e : set) {
            System.out.println(e);
        }
    }

}
